<button>ok</button>
<script>
// 宏任务 下次事件循环中执行 setTimeout, ajax返回数据
// 微任务 本次事件循环结尾 then(() => {})

window.onclick = () =>
  console.log('click')
for(let i=0; i<10**10; i++) {

}
</script>

<script>
// 事件循环 Event Loop
// js是单线程
console.log(0)
setTimeout(() => console.log(1))
Promise.resolve()
  .then(() => console.log(2))
  .then(() => console.log(3))
Promise.resolve()
  .then(() => console.log(4))
  .then(() => console.log(5))
console.log(6)
</script>